{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import json\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "path = r'D:\\我的资料库\\PycharmProjects\\pydata-book-master\\ch02\\usagov_bitly_data2012-03-16-1331923249.txt'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'D:\\\\我的资料库\\\\PycharmProjects\\\\pydata-book-master\\\\ch02\\\\usagov_bitly_data2012-03-16-1331923249.txt'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'{ \"a\": \"Mozilla\\\\/5.0 (Windows NT 6.1; WOW64) AppleWebKit\\\\/535.11 (KHTML, like Gecko) Chrome\\\\/17.0.963.78 Safari\\\\/535.11\", \"c\": \"US\", \"nk\": 1, \"tz\": \"America\\\\/New_York\", \"gr\": \"MA\", \"g\": \"A6qOVH\", \"h\": \"wfLQtf\", \"l\": \"orofrog\", \"al\": \"en-US,en;q=0.8\", \"hh\": \"1.usa.gov\", \"r\": \"http:\\\\/\\\\/www.facebook.com\\\\/l\\\\/7AQEFzjSi\\\\/1.usa.gov\\\\/wfLQtf\", \"u\": \"http:\\\\/\\\\/www.ncbi.nlm.nih.gov\\\\/pubmed\\\\/22415991\", \"t\": 1331923247, \"hc\": 1331822918, \"cy\": \"Danvers\", \"ll\": [ 42.576698, -70.954903 ] }\\n'"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "open(path).readline()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "records = [json.loads(line) for line in open(path)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'a': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.78 Safari/535.11',\n",
       " 'al': 'en-US,en;q=0.8',\n",
       " 'c': 'US',\n",
       " 'cy': 'Danvers',\n",
       " 'g': 'A6qOVH',\n",
       " 'gr': 'MA',\n",
       " 'h': 'wfLQtf',\n",
       " 'hc': 1331822918,\n",
       " 'hh': '1.usa.gov',\n",
       " 'l': 'orofrog',\n",
       " 'll': [42.576698, -70.954903],\n",
       " 'nk': 1,\n",
       " 'r': 'http://www.facebook.com/l/7AQEFzjSi/1.usa.gov/wfLQtf',\n",
       " 't': 1331923247,\n",
       " 'tz': 'America/New_York',\n",
       " 'u': 'http://www.ncbi.nlm.nih.gov/pubmed/22415991'}"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "records[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'America/New_York'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "records[0]['tz']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "time_zones = [rec['tz'] for rec in records if 'tz' in rec]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['America/New_York',\n",
       " 'America/Denver',\n",
       " 'America/New_York',\n",
       " 'America/Sao_Paulo',\n",
       " 'America/New_York',\n",
       " 'America/New_York',\n",
       " 'Europe/Warsaw',\n",
       " '',\n",
       " '',\n",
       " '']"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time_zones[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "def get_counts(sequence):\n",
    "    counts = {}\n",
    "    for x in sequence:\n",
    "        if x in counts:\n",
    "            counts[x] = counts[x] + 1\n",
    "        else:\n",
    "            counts[x] = 1\n",
    "    return counts        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "counts = get_counts(time_zones)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "def top_counts(count_dict,n=10):\n",
    "    vakey_p = [(count, tz) for tz, count in count_dict.items()]\n",
    "    vakey_p.sort()\n",
    "    return vakey_p[-n:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[(33, 'America/Sao_Paulo'),\n",
       " (35, 'Europe/Madrid'),\n",
       " (36, 'Pacific/Honolulu'),\n",
       " (37, 'Asia/Tokyo'),\n",
       " (74, 'Europe/London'),\n",
       " (191, 'America/Denver'),\n",
       " (382, 'America/Los_Angeles'),\n",
       " (400, 'America/Chicago'),\n",
       " (521, ''),\n",
       " (1251, 'America/New_York')]"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "top_counts(counts)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c[2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from pandas import DataFrame, Series"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {},
   "source": [
    "import pandas as pd \n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "frame = DataFrame(records)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     America/New_York\n",
       "1       America/Denver\n",
       "2     America/New_York\n",
       "3    America/Sao_Paulo\n",
       "4     America/New_York\n",
       "5     America/New_York\n",
       "6        Europe/Warsaw\n",
       "7                     \n",
       "8                     \n",
       "9                     \n",
       "Name: tz, dtype: object"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "frame['tz'][:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "America/New_York       1251\n",
       "                        521\n",
       "America/Chicago         400\n",
       "America/Los_Angeles     382\n",
       "America/Denver          191\n",
       "Europe/London            74\n",
       "Asia/Tokyo               37\n",
       "Pacific/Honolulu         36\n",
       "Europe/Madrid            35\n",
       "America/Sao_Paulo        33\n",
       "dtype: int64"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "frame['tz'].value_counts()[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Populating the interactive namespace from numpy and matplotlib\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x9286ba8>"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data":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G24sk7UvVQ3+V7a4mkLb43wacTXUVLlT/hw4CptMb8b/V9i/KthOBJba/PprPPwkwIiJq\nKecAIyKilpIAIyKilpIAIyKilpIAIyKilpIAIyKilpIAIyKilpIAIyKilpIAIyKilpIAIyKilv4/\nbTWdCNCGCccAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x92b9358>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%pylab inline\n",
    "frame['tz'].value_counts()[:10].plot(kind='barh',rot=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'GoogleMaps/RochesterNY'"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "frame['a'][1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2'"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "frame['a'][50]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "results = Series([x.split()[0] for x in frame.a.dropna()])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Mozilla/5.0                 2594\n",
       "Mozilla/4.0                  601\n",
       "GoogleMaps/RochesterNY       121\n",
       "Opera/9.80                    34\n",
       "TEST_INTERNET_AGENT           24\n",
       "GoogleProducer                21\n",
       "Mozilla/6.0                    5\n",
       "BlackBerry8520/5.0.0.681       4\n",
       "BlackBerry8520/5.0.0.592       3\n",
       "Dalvik/1.4.0                   3\n",
       "dtype: int64"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "results.value_counts()[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "cframe = frame[frame.a.notnull()]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "operating_system = np.where(cframe['a'].str.contains('Windows'),'Windows','Not Windows')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['Windows', 'Not Windows', 'Windows', 'Not Windows', 'Windows'], \n",
       "      dtype='<U11')"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "operating_system[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "by_tz = cframe.groupby(['tz',operating_system])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "agg_counts = by_tz.size().unstack().fillna(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Not Windows</th>\n",
       "      <th>Windows</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>tz</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <td>245</td>\n",
       "      <td>276</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Africa/Cairo</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Africa/Casablanca</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Africa/Ceuta</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Africa/Johannesburg</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Africa/Lusaka</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Anchorage</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Argentina/Buenos_Aires</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Argentina/Cordoba</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Argentina/Mendoza</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                Not Windows  Windows\n",
       "tz                                                  \n",
       "                                        245      276\n",
       "Africa/Cairo                              0        3\n",
       "Africa/Casablanca                         0        1\n",
       "Africa/Ceuta                              0        2\n",
       "Africa/Johannesburg                       0        1\n",
       "Africa/Lusaka                             0        1\n",
       "America/Anchorage                         4        1\n",
       "America/Argentina/Buenos_Aires            1        0\n",
       "America/Argentina/Cordoba                 0        1\n",
       "America/Argentina/Mendoza                 0        1"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "agg_counts[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "indexer = agg_counts.sum(1).argsort()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tz\n",
       "                                  24\n",
       "Africa/Cairo                      20\n",
       "Africa/Casablanca                 21\n",
       "Africa/Ceuta                      92\n",
       "Africa/Johannesburg               87\n",
       "Africa/Lusaka                     53\n",
       "America/Anchorage                 54\n",
       "America/Argentina/Buenos_Aires    57\n",
       "America/Argentina/Cordoba         26\n",
       "America/Argentina/Mendoza         55\n",
       "dtype: int64"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "indexer[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "count_subset = agg_counts.take(indexer)[-10:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Not Windows</th>\n",
       "      <th>Windows</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>tz</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>America/Sao_Paulo</th>\n",
       "      <td>13</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/Madrid</th>\n",
       "      <td>16</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Pacific/Honolulu</th>\n",
       "      <td>0</td>\n",
       "      <td>36</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Asia/Tokyo</th>\n",
       "      <td>2</td>\n",
       "      <td>35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Europe/London</th>\n",
       "      <td>43</td>\n",
       "      <td>31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Denver</th>\n",
       "      <td>132</td>\n",
       "      <td>59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Los_Angeles</th>\n",
       "      <td>130</td>\n",
       "      <td>252</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/Chicago</th>\n",
       "      <td>115</td>\n",
       "      <td>285</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <td>245</td>\n",
       "      <td>276</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>America/New_York</th>\n",
       "      <td>339</td>\n",
       "      <td>912</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                     Not Windows  Windows\n",
       "tz                                       \n",
       "America/Sao_Paulo             13       20\n",
       "Europe/Madrid                 16       19\n",
       "Pacific/Honolulu               0       36\n",
       "Asia/Tokyo                     2       35\n",
       "Europe/London                 43       31\n",
       "America/Denver               132       59\n",
       "America/Los_Angeles          130      252\n",
       "America/Chicago              115      285\n",
       "                             245      276\n",
       "America/New_York             339      912"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "count_subset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x7e096a0>"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAc8AAAD7CAYAAAAM5B8kAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmcVNWd///Xm0XQDiC4IUFWoyiIgAh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ITk0AfAk8G6JxQ+N+5v/H5KhQ4Ch\nwKPFCXVbkvYB9k9PtPkEyZewkok/ImYCSDoX2BARi5qz/32ThBKXHtBeBewcEdkih7Ndkv6D5Jve\n30mSz63AHsCbwN8j4pX0TNB9Sf65Px8R7xUr3u1Jk+fXgctIjjmXRPySOgP/DmSBg0n2fynF3x2Y\nDjwHDAPuJuk9tOn408MU95KcGbyC+vf57yNijaQjSEYGdouIoiafvPhPAq4lOdsZkr+h44FBlEb8\nkyLiz+myc4GNEfGL5ux/J08zM7MC+ZinmZlZgZw8zczMCuTkaWZmViAnTzMzswI5eZqZmRXIydPM\nzKxATp5mZmYFcvI0MzMrkJOnmZlZgf5/l6RrnvnX0ocAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7e0c160>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "count_subset.plot(kind='barh',stacked=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "normed_subset = count_subset.div(count_subset.sum(1),axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "normed>"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.4.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
